//
//  ViewController.swift
//  表情键盘
//
//  Created by zhangguo on 15/10/17.
//  Copyright © 2015年 zhangguo. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    //键盘输入的视图
    private lazy var emotionVC:EmotionViewController  = EmotionViewController {[weak self] (emotion) -> () in
        
        self?.textView.insertEmoticon(emotion)
        
        }
  
    @IBAction func emoticonText(sender: AnyObject) {
        
        print("结果\(textView.emoticonText)")
    }
    
    
    deinit {
        print("88")
    }
    
    @IBOutlet weak var textView: UITextView!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        //设置自定义键盘
        textView.inputView = emotionVC.view
        
        //测试
        print(EmoticonsPackage.packages())
        
        
           }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
    }


}

